import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Api } from '../../../providers/api-service';

/**
 * 会员状态
 */
@IonicPage()
@Component({
  selector: 'page-user-xufeihuiyuan',
  templateUrl: 'user-xufeihuiyuan.html',
})
export class UserXufeihuiyuanPage {
  name;
  kaitong;


  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    public api: Api
  ) {

    this.init();
  }

  ionViewDidLoad() {

  }
  /**
   * 初始化
   */
  init() {
    this.name = this.api.getUserinfo("NickName");
    let IsVip = this.api.getUserinfo("IsVip");
    if (IsVip == 1) {
      this.kaitong = "立即续费"
    } else {
      this.kaitong = "开通会员";
    }
  }

  onKaiTong(){
    let options = [
      {
        icon: 'ios-arrow-forward',
        text: "支付宝",
       
        handler: () => {
          //console.log("支付宝");
        }
      },
      {
        text: "微信支付",
        handler: () => {
          //console.log("微信");
        }
      }
    ];
    this.api.presentActionSheet("选择支付方式",options);
  }


    











}
